var nganu;
var site_id = "-1";
var category="-1";
var categoryId="-1";
Ext.define('NIM.controller.AssetDataMaster', {
    extend: 'Ext.app.Controller',

    views: [
        'AssetDataMaster.site_list',
        'AssetDataMaster.AddNewSiteMaster',
        'AssetDataMaster.AssetLandForm',
        'AssetDataMaster.AssetHeaderForm',
        'AssetDataMaster.AssetTowerForm',
        'AssetDataMaster.AssetPLNForm',
        'AssetDataMaster.AssetNonSacForm',
        'AssetDataMaster.AssetNonSacGrid'
    ],
    
    stores: [
        'AssetDataMaster.SiteList',  
        'AssetDataMaster.SiteDetails',  
        'AssetDataMaster.Area',   
        'AssetDataMaster.Regional',
        'AssetDataMaster.Kabupaten',   
        'AssetDataMaster.Provinsi',
        'AssetDataMaster.Kecamatan',
        'AssetDataMaster.Kelurahan',
        'AssetDataMaster.Treeview',
        'AssetDataMaster.AssetNonSac',
        'AssetDataMaster.Category',
        'AssetDataMaster.SubCategory',
        'AssetDataMaster.Brand',
        'AssetDataMaster.Type',
        'AssetDataMaster.AssetLandPbb',
        'AssetDataMaster.AssetTowerContract',
        'AssetDataMaster.AssetTowerImb',
        'AssetDataMaster.AssetNonSacLogs',
        'AssetDataMaster.TowerCompany',
        'AssetDataMaster.MainCat',
        'AssetDataMaster.SubCat1',
        'AssetDataMaster.SubCat2',
        'AssetDataMaster.SubCat3'
    ],

//    models: ['User'],

    init: function() {
        this.control({
        	'textfield': { 
                specialkey: function(field, e) { 
                    if(e.getKey() == e.ENTER) { 
                         field.up('form').getForm().submit({
                        	 success: function(form, action) {
                                 Ext.Msg.alert('Submited', action.response.responseText);
                              },
                              failure: function(form, action) {
                                  Ext.Msg.alert('Submited', action.response.responseText);
                              }
                        	 
                         }); 
                    } 
                } 
        	 }
        
        
        	
        	
        });
        
        
    }

   
});
